﻿using System.Windows.Controls;
using SUNRPA.CONTROLS.IMPL.util;
using System;
using System.IO;
using Microsoft.Win32;
using RPAVIEW.views.controlLibrary;

namespace RPAVIEW.views.EditPage.flows.FileReNameN {
   
    public partial class Input:BaseParamViewAction{
        public Input() {
            InitializeComponent();
        }
        public override void UpdateSource() {
            this.waitRenameFile.GetBindingExpression(SelVarTextBox.text).UpdateSource();
            this.newName.GetBindingExpression(SelVarTextBox.text).UpdateSource();
        }

        private void selectFile(object sender, System.Windows.RoutedEventArgs e){
            OpenFileDialog openFileDlg = FileUtil.OpenFileSelectDialog(".*", "所有文件 (*.*)|*.*", string.Empty);
            bool? dialogResult = openFileDlg.ShowDialog();
            if (dialogResult ?? false) {
                this.waitRenameFile.Text = openFileDlg.FileName;
            }
        }
    }
}
